package demo_0421;

public class Main02 {
    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(new MyCountRunnable());
        thread.setName("王五");
        thread.start();
        thread.join(2000);


        Thread.currentThread().setName("牢大");
        for (int i = 0; i <= 10; i++) {
            System.out.println(Thread.currentThread().getName() + " " + i);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
